package com.woniuxy.util;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author ：CuiYC
 * @description：
 * @date ：Created in 2025/3/20 19:34
 * @modified By：
 */
public class MyDateTimeUtil {
    public static final String DATE_FORMAT = "yyyy-MM-dd";
    public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";

    public static LocalDateTime StringToLocalDataTime(String dateTimeStr) {
        return LocalDateTime.parse(dateTimeStr, DateTimeFormatter.ofPattern(DATE_TIME_FORMAT));
    }
    public static String LocalDateTimeToString(LocalDateTime localDateTime) {
        return localDateTime.format(DateTimeFormatter.ofPattern(DATE_TIME_FORMAT));
    }
}
